package fun.qu_an.minecraft.fabric.fzbbl;

import fun.qu_an.minecraft.fabric.fzbbl.event.ScoreboardEvents;
import fun.qu_an.minecraft.fabric.fzbbl.event.ServerPistonCarvingEvents;
import fun.qu_an.minecraft.fabric.fzbbl.handle.PistonBrokeBedrockHandle;
import fun.qu_an.minecraft.fabric.fzbbl.handle.ScoreboardAddedHandle;
import fun.qu_an.minecraft.fabric.fzbbl.handle.ScoreboardRemovedHandle;
import net.fabricmc.api.ModInitializer;
import net.minecraft.scoreboard.ScoreboardObjective;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import java.util.List;
import java.util.Vector;

public class FZBBL implements ModInitializer {
	// 破基岩记分板
	/**
	 * 连点器破基岩计分板
	 */
	public static final List<ScoreboardObjective> BBL = new Vector<>();
	/**
	 * 机器破基岩计分板
	 */
	public static final List<ScoreboardObjective> MBB = new Vector<>();
	/**
	 * 条件宽松的破基岩计分板
	 */
	public static final List<ScoreboardObjective> LBL = new Vector<>();

	public static final Logger LOGGER = LogManager.getLogger("FZ-BBL");

	@SuppressWarnings("CommentedOutCode")
	@Override
	public void onInitialize() {
		// 会导致玩家打不开统计信息，故不添加自定义判据
//		Registry.register(Registry.CUSTOM_STAT, "fzbbl.bedrock_broken", new Identifier("fzbbl", "bedrock_broken"));
//		Registry.register(Registry.CUSTOM_STAT, "fzbbl.bedrock_broken", new Identifier("fzbbl", "bedrock_broken"));
//		Registry.register(Registry.CUSTOM_STAT, "fzbbl.bedrock_broken", new Identifier("fzbbl", "bedrock_broken"));
		ScoreboardEvents.ADDED.register(ScoreboardAddedHandle::handle);
		ScoreboardEvents.REMOVED.register(ScoreboardRemovedHandle::handle);
		ServerPistonCarvingEvents.PLAYER.register(PistonBrokeBedrockHandle::handle);
		ServerPistonCarvingEvents.MACHINE.register(PistonBrokeBedrockHandle::handle);
	}
}
